package UnitTests;

import Plants.PowerPlant;
import SmartGrid.EnergyMarket;
import SmartGrid.ExecutionEngine;
import SmartGrid.SmartGrid;
import Tools.Log;

public class BasicGridSimulation {

	private void init()
	{
		ExecutionEngine.init();
		EnergyMarket.init();
		Log.init("Errorlog");
	}
	
	public void runBasicGridSimulation()
	{
		ExecutionEngine.init();
		SmartGrid smartgrid = new SmartGrid("smartgrid.txt");		
		PowerPlant p1 = smartgrid.getPlant("Plant1");
		PowerPlant p2 = smartgrid.getPlant("Plant2");
		p1.sendEnergy(p2, 100);
		//Want to make the main thread wait here
		smartgrid.printEnergyLevels();
		ExecutionEngine.shutDown();
	}
	
	public void runEnergyMarketSimulation()
	{
		ExecutionEngine.init();
		SmartGrid smartgrid = new SmartGrid("smartgrid.txt");
		EnergyMarket.init();
		ExecutionEngine.shutDown();
	}
	
}
